//
//  LTNavigationViewController.swift
//  textweibo
//
//  Created by 李付涛 on 2017/3/16.
//  Copyright © 2017年 江苏岳创信息科技有限公司. All rights reserved.
//

import UIKit

class LTNavigationViewController: UINavigationController {
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        //隐藏默认的navigationbar
        navigationBar.isHidden = true
    }

    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        
        
        
        
        
        if childViewControllers.count > 0 {
            
            viewController.hidesBottomBarWhenPushed = true
            if let vc = viewController as? LTBaseViewController {
                
                vc.naviItem.leftBarButtonItem = UIBarButtonItem(title: "返回", action: #selector(popToVC), target: self, isBack:true)
                
            }

        }
        
        
        super.pushViewController(viewController, animated: true)
        
        
    }
   
    @objc func popToVC(){
        popViewController(animated: false)
    }
    
}
